package demo1;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.lang.reflect.AnnotatedArrayType;

public class Demo1 {
    public static void main(String[] args) throws Exception {
        Person p=new Person();
        p.sayHello();

        Class cla=Class.forName("demo1.Person");
        Person p1=(Person)cla.newInstance();
        p1.sayHello();

        AnnotationConfigApplicationContext context
                =new AnnotationConfigApplicationContext("demo1");

        Person p2=context.getBean(Person.class);
        p2.sayHello();
    }
}
